import { defHttp } from '@/utils/http/axios';
enum Api {
 
  // addAudienceGroupAPI = '/mv/template/createAdvertisementTemplate',
  // getAudienceGroupAPI = '/mv/template/pageAdvertisementTemplate',
  // getAudiencesListAPI = '/mv/template/listAdvertisementTemplate',
  //私信
  taskChatAPI="/mv/taskChat/page",
  createTaskChat='/mv/taskChat/createTask'
}

export function createTaskChat(params) {
  return defHttp
    .post(
      {
        url: `${Api.createTaskChat}`,
        params,
      },
      {
        isTransformResponse: false,
      },
    )
    .then((res) => {
      return res;
    });
}

// export function getAudiencesListAPI() {
//   return defHttp
//     .post(
//       {
//         url: `${Api.getAudiencesListAPI}`,
//       },
//       {
//         isTransformResponse: false,
//       },
//     )
//     .then((res) => {
//       return res;
//     });
// }
export function taskChatAPI(params) {
  params['current'] = params.page;
  params['size'] = params.pageSize;
  return defHttp
    .post(
      {
        url: Api.taskChatAPI,
        params,
      },
      {
        isTransformResponse: false,
      },
    )
    .then((res) => {
      const { records, total } = res.data;
      return {
        items: records, // 将数据列表赋值给 items
        total, // 直接使用 total
      };
    })
    .catch((err) => {
      console.log(err, '虚拟机');
    });
}
